<?php

namespace IDock\Insurance\ZFIC\Response;

use IDock\Http\Response;
use IDock\Insurance\ZFIC\Response\AllZFICResponse;
use IDock\Printer\UnderwritingRecallPrinter;
use IDock\Printer\UploadFilePrinter;

class CancelOrderResponse extends AllZFICResponse
{

    public function printerInit(): Response
    {
        $underwritingRecallPrinter = new UnderwritingRecallPrinter();

        $this->printer = $underwritingRecallPrinter;

        $data = $this->getBody();
        if($data['state'] != '200'){
            $underwritingRecallPrinter->isSuccess = false;
            $underwritingRecallPrinter->errorTip = $data['msg'];
            $this->setError($data['msg']);
            $this->printer = $underwritingRecallPrinter;
            return $this;
        }

        $underwritingRecallPrinter->isSuccess = true;
        $this->printer = $underwritingRecallPrinter;
        return $this;
    }
}